<template>
  <div class="ehb all">
    <ehb-header service-name="我要办" v-bind:area="jdmc"></ehb-header>
    <ehb-content-row v-bind:row-data-list="ywlxList"></ehb-content-row>
    <ehb-footer></ehb-footer>
  </div>
</template>

<script>
    export default {
        name: "YwlxList",
        data() {
            return {
                jdmc: "",
                ywlxList: [
                    // {"name":"预告登记","url":"","params":{"ywlxjj":"xxx"}}
                  {"name": "补办证明", "url":"/bubanzm", "params": {ywlxbm:"5008"}},
                  {"name": "补办不动产证书", "url":"/bbbdczs", "params": {ywlxbm:"5003"}}
                ],
                provider: ""
            }
        },
        mounted() {
            var that = this;
            ehbAppJssdk.operateWindow.getPrePageParams({
                success: function (res) {
                    var resJSON = JSON.parse(res);

                    that.jdmc = resJSON.jdmc;
                    that.provider = resJSON.provider;
                    ehbAppJssdk.network.request({
                        url: that.GLOBAL.urlConfig.getJdYwlx[that.GLOBAL.urlType],
                        method: 'post',
                        data: {
                            "jdid": resJSON.id,
                            "sfsx":'0'
                        },
                        headers: {'contentType': 'application/x-www-form-urlencoded'},
                        success: function (data) {
                            if (data.status == 0) {
                                let result = data.result;
                                for (let i in result) {
                                    let res = result[i];
                                    let url = "";
                                    resJSON = {...resJSON,...res};
                                    if (res.ywlxbm == "005") {
                                        resJSON.ywlxbm = "005";
                                        url = "/onlineProcessing/Qkysfzydj";
                                    }
                                    if (res.ywlxbm == "006") {
                                        resJSON.ywlxbm = "006";
                                        url = "/onlineProcessing/Ybdydj";

                                    }
                                    if (res.ywlxbm == "0061") {
                                        resJSON.ywlxbm = "0061";
                                        url = "/onlineProcessing/FdZgedydj";

                                    }
                                    if (res.ywlxbm == "007") {
                                        resJSON.ywlxbm = "007";
                                        url = "/onlineProcessing/Dyzxdj";

                                    }
                                    if (res.ywlxbm == "010") {
                                        resJSON.ywlxbm = "010";
                                        url = "/onlineProcessing/Esfzydj";
                                        /*that.ywlxList.push({"name": res.ywlxmc, "url": url, "params": resJSON});*/
                                    }
                                    if (res.ywlxbm == "011") {
                                        resJSON.ywlxbm = "011";
                                        url = "/onlineProcessing/Bgdj";
                                    }
                                    if (res.ywlxbm == "012") {
                                        resJSON.ywlxbm = "012";
                                        url = "/onlineProcessing/Ygdj";
                                    }
                                    if (res.ywlxbm == "008") {
                                        resJSON.ywlxbm = "008";
                                        url = "/onlineProcessing/Gyjsydsyqjfwsyqzxdj";
                                    }
                                    if (res.ywlxbm == "002") {
                                        resJSON.ywlxbm = "002";
                                        url = "/onlineProcessing/Ygspfdyygdj";
                                    }
                                    if (res.ywlxbm == "004") {
                                        resJSON.ywlxbm = "004";
                                        url = "/onlineProcessing/Ygspfdyygzxdj";
                                    }
                                    that.ywlxList.push({"name": res.ywlxmc, "url": url, "params": resJSON});
                                }
                            } else {
                                that.toNOData("没有查询到该节点的业务信息");
                            }
                        },
                        fail: function (res) {
                            that.toNOData("没有查询到该节点的业务信息");
                        }
                    });
                }
            });
        }
    }
</script>

<style scoped>

</style>
